from Utils import select_message_from_database

# 获取当前用户的对话记录,组成data中的message格式
memory = select_message_from_database('张同学【gpt版】')
message = []
for item in memory:
    temp = {
        'content':'',

        'role':''
    }
    temp['role'] = item[1]
    temp['content'] = item[2]
    message.append(temp)

print(message)